<?php
declare(strict_types=1);

namespace app\admin\service;

use app\admin\model\SubscribeLog as SubscribeLogModel;

/**
 * 工作经验
 * Class WorkExperienceService
 * @package app\admin\service
 */
class SubscribeLogService
{
    /**
     * 更新订阅记录
     * @param $where
     * @param $params
     * @return SubscribeLogModel|bool
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function updateSubscribeLog($where, $params)
    {
        $subscribeLog = SubscribeLogModel::findSubscribeLog($where);
        $res = true;
        if ($subscribeLog) {
            $res = SubscribeLogModel::updateSubscribeLog($where, [
                // 标注“推送”状态
                'is_tagging' => 1,
                'status' => $params['status']
            ]);
        }
        return $res;
    }
}